﻿using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace Core.Runtime
{
    public static class GameSettings
    {
        public static string LogicMainDll => GameSettingSo.Instance.LogicMainDll;
        public static List<string> HotUpdateAssemblies => GameSettingSo.Instance.HotUpdateAssemblies;
        public static List<string> AOTMetaAssemblies => GameSettingSo.Instance.AotMetaAssemblies;
        public static string AssemblyAssetExtension => GameSettingSo.Instance.AssemblyAssetExtension;
        public static string AssemblyAssetPath => GameSettingSo.Instance.AssemblyAssetPath;
        public static RuntimeMode RuntimeMode => GameSettingSo.Instance.RuntimeMode;
        public static bool IsEditorMode => GameSettingSo.Instance.IsEditorMode;
        public static float UnloadBundleDelay => GameSettingSo.Instance.UnloadBundleDelay;
        public static float UnloadAssetDelay => GameSettingSo.Instance.UnloadAssetDelay;
        public static int MaxConcurrentTasks => GameSettingSo.Instance.MaxConcurrentTasks;

        public static string PlatformName => Application.platform switch
        {
            RuntimePlatform.Android => "Android",
            RuntimePlatform.IPhonePlayer => "IOS",
            RuntimePlatform.WebGLPlayer => "WebGL",
            RuntimePlatform.WindowsEditor or RuntimePlatform.WindowsPlayer => "StandaloneWindows64",
            RuntimePlatform.OSXEditor or RuntimePlatform.OSXPlayer => "MacOS",
            _ => throw new PlatformNotSupportedException()
        };
    }
}